package com.xxwy.bean.instantiation;

import com.xxwy.bean.User;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author wy
 * @date 2020/4/21 14:23
 */
public class BeanInstantiationDemo {

  public static void main(String[] args) {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:/META-INF/bean-create-context.xml");
    User user = context.getBean("user-by-staticMethod", User.class);
    User user2 = context.getBean("user-by-Bean", User.class);
    User user3 = context.getBean("user-by-factoryBean", User.class);
    System.out.println(user == user2);
    System.out.println(user2 == user3);

  }
}
